/*
 * @Author: wcx 1055127249@qq.com
 * @Date: 2025-01-07 17:31:03
 * @LastEditors: wcx 1055127249@qq.com
 * @LastEditTime: 2025-01-10 16:52:17
 * @FilePath: \my-project\src\views\CreateProcess\register\activity.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { Graph } from '@antv/x6'

Graph.registerNode(
  'custom',
  {
    width: 100,
    height: 60,
    markup: [
      {
        tagName: 'rect',
        selector: 'body',
      },
      {
        tagName: 'image',
        selector: 'icon',
      },
      {
        tagName: 'text',
        selector: 'label',
      },
      {
        tagName: 'text',
        selector: 'error',
      },
    ],
    attrs: {
      body: {
        rx: 10,
        ry: 10,
        fill: 'transparent',
        stroke: '#5F95FF',
        refWidth: '100%',
        refHeight: '100%',
        strokeWidth: 2,
        pointerEvents: 'visiblePainted',
      },
      icon: {
        x: 6,
        y: 6,
        width: 16,
        height: 16,
        'xlink:href': '/icon-user.png',
      },
      label: {
        x: 50,
        y: 30,
        refWidth: '100%',
        refHeight: '100%',
        fontSize: 14,
        textAnchor: 'middle',
        textVerticalAnchor: 'middle',
      },
      error: {
        x: 1,
        y: 80,
        fill: '#f00',
        fontSize: 12,
        textAnchor: 'start',
        textVerticalAnchor: 'bottom',
      },
    },
  },
  true,
)
